#include<iostream>
#include<string>
using namespace std;

class Product
{
public:
	Product()
	{
	}
	~Product()
	{
	}
	void ProducePart()
	{
	}
};
class ProductPart
{
public:
	ProductPart()
	{
	}
	~ProductPart()
	{
	}
	ProductPart* BuildPart()
	{
	}
};

class Builder
{
public:
	virtual ~Builder()
	{
	}
	virtual void BuildPartA(const string& buildPara) = 0
	{
	}
	virtual void BuildPartB(const string& buildPara) = 0
	{
	}
	virtual void BuildPartC(const string& buildPara) = 0
	{
	}
	virtual Product* GetProduct() = 0
	{
	}
protected:
	Builder()
	{
	}
};
class ConcreteBuilder:public Builder
{
public:
	ConcreteBuilder()
	{
	}
	~ConcreteBuilder()
	{
	}
	void BuildPartA(const string& buildPara)
	{
		cout<<"Step1:Build PartA..."<<buildPara<<endl;
	}
	void BuildPartB(const string& buildPara)
	{
		cout<<"Step2:Build PartB..."<<buildPara<<endl;
	}
	void BuildPartC(const string& buildPara)
	{
		cout<<"Step3:Build PartC..."<<buildPara<<endl;
	}
	Product* GetProduct()
	{
		BuildPartA("pre-defined");
		BuildPartB("pre-defined");
		BuildPartC("pre-defined");
		return new Product();
	}
};

class Director
{
public:
	Director(Builder* bld)
	{
		_bld = bld;
	}
	~Director()
	{
	}
	void Construct()
	{
		_bld->BuildPartA("user-defined");
		_bld->BuildPartB("user-defined");
		_bld->BuildPartC("user-defined");
	}
private:
	Builder* _bld;
};

int main(int argc,char* argv[])
{
	Director* d = new Director(new ConcreteBuilder());
	d->Construct();
	return 0;
}